// 统一管理项目中所有的请求路径
// 引入request
import request from "./request"
import qs from 'qs'

// 首页精品的地址
export const JingpinAPI = () =>request.get("/products/recommend")
//精品推荐

export const HotAPI = () =>request.get("/products/hot")
//热门推荐

export const DetaliAPI = (id) =>request.get(`/products/${id}`)//必须用   ``  号
//商品详情

export const sendAPI = (params) =>request.post("/sendSMS",qs.stringify(params))
//注册

export const phoneReginAPI = (num) =>request.post("/phoneRegin",qs.stringify(num))
//注册，带登录

export const userAPI = () =>request.get("/shop/userProfiles")
//用户

export const addAPI = (add) =>request.post("/shop/carts/add",qs.stringify(add))
//添加购物车

export const cartsAPI = () =>request.get("/shop/carts")
//查看购物车

export const cartsouAPI = (params) =>request.get("/products",{params})
//发起商品搜索的请求

export const delAPI = (id) =>request.delete(`/shop/carts?productIds=${id}`)
//删除购物车

export const CmsCartAPI = (params) =>request.put("/shop/carts",JSON.parse(params))